﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace BookManagementWpfApplication.Converters
{
    public class BookStatusConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var TextBookStatus = (byte)value;

            switch (TextBookStatus)
            {        

                case 1 :
                    return "ยืม";
                    break;

                case 2 :
                    return "ว่าง";
                    break;

                case 3 :
                    return "ชำรุด";
                    break;

                case 4 :
                    return "สูญหาย";
                    break;

                case 5 :
                    return "ส่งซ่อม";
                    break;

                case 6 :
                    return "จัดซื้อใหม่";
                    break;

                case 7 :
                    return "ลบ";
                    break;

                default:
                    return "";
                    break;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
